<template>
    <div>
        <mixinsObj></mixinsObj>
        <template>
            <el-table :data="treeList" border style="width: 100%">
                <el-table-column type="index" label="#" width="180">
                </el-table-column>
                <el-table-column prop="authName" label="权限名称" width="180">
                </el-table-column>
                <el-table-column prop="path" label="路径">
                </el-table-column>
                <el-table-column label="权限等级">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.level == 0">一级权限</el-tag>
                        <el-tag v-if="scope.row.level == 1" type="success">二级权限</el-tag>
                        <el-tag v-if="scope.row.level == 2" type="warning">三级权限</el-tag>
                    </template>

                </el-table-column>
            </el-table>
        </template>
    </div>
</template>
<script>
import mixinsObj from '@/views/mixins.vue'
export default {
    components: { mixinsObj },
    data() {
        return {
            treeList: []
        }
    },
    methods: {
        async getTreeList() {
            let { data: res } = await this.$http.get('rights/list')
            this.treeList = res.data
        }
    },
    mounted() {
        this.getTreeList()
    }
}
</script>